home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / tuning / download / xteq / setup.exe / {app} / plugins / XQ Find Menu 1.xpl < prev    next >
Text File  |  2001-05-14  |  6KB  |  156 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 5.0"
  2. "TYPE"="6"
  3. "COUNT"="4"
  4. "UIPATH"="Appearance\Start Menu\Visible Items"
  5. "NAME"="Visible Items in Start->Find"
  6. "LANGUAGE"="VBScript"
  7. "VERSION"="2.18"
  8. "TEXT 1"="Files or Folders \ Computer"
  9. "TEXT 2"="People"
  10. "TEXT 3"="On The Internet"
  11. "TEXT 4"="Microsoft Find Extensions Powertoy"
  12. "DESCRIPTION 1"="This plug-in lets you control which options are shown on the Find menus on the Start Menu and in Windows Explorer. These icons are all part of Windows or Internet Explorer."
  13. "DESCRIPTION 2"="To show an option on the menu, enable it, otherwise disabling the option will hide it. Changes take effect immediately, and this will affect all users of this computer."
  14. "DESCRIPTION 3"="Note #1: If 'Files or Folders' is hidden, 'Computer' will also be hidden."
  15. "DESCRIPTION 4"="Note #2: 'People' requires Outlook Express to be installed, and 'On The Internet' requires Internet Explorer to be installed. 'Microsoft Find Extensions Powertoy' requires the Find Extensions Powertoy to be installed."
  16. "DESCRIPTION 5"="Note #3: Disabling all items will lead to an empty menu being displayed."
  17. "COMMENT 1"="I didn't *find* this plug-in very difficult to make :)"
  18. "AUTHOR"="Neil R. Turner (totalxs@hotmail.com) for Xteq Systems"
  19. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  20. "CONTACTURL"="http://www.neilrt.cwc.net/"
  21.  
  22. ' Normally I'm a bit shy of comments but I thought I'd add some
  23. ' so that you people can see how this works. Cool, eh? :)
  24. '
  25. ' Outlook Express folder (for the WAB icon)
  26. OE="HKLM\Software\Microsoft\Outlook Express\InstallRoot"
  27. '
  28. ' Windows\System folder (for the WebSearch icon)
  29. w=GetWinSysDir
  30. '
  31. ' Where all of the Find keys are installed:
  32. s1="HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\FindExtensions"
  33. '
  34. ' The Files/Folders entry:
  35. s2="\ShellFind"
  36. '
  37. ' 'Static' entries - these are the extensions (People/Internet)
  38. s3="\Static\"
  39. '
  40. ' The Powertoy CLSID
  41. FF="{61E218E0-65D3-101B-9F08-061CEAC3D50D}"
  42.  
  43. 'Called when the Plugin is started
  44. SUB Plugin_Initialize
  45.  
  46.  ' Find out whether Files/Folders is enabled
  47.  a=RegReadValue(s1 & s2 & "\@")
  48.  if a=FF then
  49.   Call SetUIElement(1,true)
  50.  end if
  51.  
  52.  ' Find out whether People is enabled (or should that be "are"?)
  53.  a=RegReadvalue(s1 & s3 & "WabFind\@")
  54.  if IsEmpty(a)=false then
  55.   Call SetUIElement(2,true)
  56.  end if
  57.  
  58.  ' Ditto for On The Internet
  59.  a=RegReadValue(s1 & s3 & "WebSearch\@")
  60.  if IsEmpty(a)=false then
  61.   Call SetUIElement(3,true)
  62.  end if
  63.  
  64.  ' And finally, the Powertoy
  65.  a=RegReadValue(s1 & "\{97E2C371-FDDD-11CF-807F-02608C8D98DF}\@")
  66.  if IsEmpty(a)=false then
  67.   Call SetUIElement(4,true)
  68.  end if
  69. END SUB
  70.  
  71. SUB Plugin_CheckData(ElementIndex)
  72. ' This is only here for X-Setup 5.7 compatibility - since we are only using
  73. ' checkboxes we don't need this. And besides, X-Setup 6.0 ignores it completely!
  74. END SUB
  75.  
  76. 'Called when the Plugin should apply the changes
  77. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  78.  
  79.  ' Files/Folders. This is nice and easy, either the value is there, or it isn't.
  80.  b=GetUIElement(1)
  81.  if b=true then
  82.   Call RegWriteValue(s1 & s2 & "\@","{61E218E0-65D3-101B-9F08-061CEAC3D50D}",1)
  83.  else
  84.   Call RegDeletePath(s1 & s2)
  85.  end if
  86.  
  87.  ' This is more difficult....
  88.  b=GetUIElement(2)
  89.  if b=true then
  90.   ' user wants this enabled....
  91.   ' Add GUID:
  92.   Call RegWriteValue(s1 & s3 & "WabFind\@","{32714800-2E5F-11d0-8B85-00AA0044F941}",1)
  93.   ' Add name as it should appear on Find menu:
  94.   Call RegWriteValue(s1 & s3 & "WabFind\0\@","&People...",1)
  95.   ' Give it a nice icon (this is where we use the OE variable)
  96.   o=RegReadValue(OE)
  97.   Call RegWriteValue(s1 & s3 & "WabFind\0\DefaultIcon\@", o & "\wabfind.dll, 0",1)
  98.   ' Done!
  99.  else
  100.   ' User wants this disabled....
  101.   ' See if it was previously enabled:
  102.   f=RegPathExists(s1 & s3 & "WabFind")
  103.   if f=true then
  104.    ' Get rid of Icon and its path
  105.    ' (NB: This will crash if there are extra values here, but this isn't likely)
  106.    Call RegDeleteValue(s1 & s3 & "WabFind\0\DefaultIcon\@")
  107.    Call RegDeletePath(s1 & s3 & "WabFind\0\DefaultIcon")
  108.    ' Now we need to check if there is a 'helptext' entry (Windows 2000... I think)
  109.    ' If it exists, we need to get rid of it (it shouldn't exist, but yah never know :)
  110.    g=RegPathExists(s1 & s3 & "WabFind\0\HelpText")
  111.    if g=true then
  112.     Call RegDeletePath(s1 & s3 & "WabFind\0\HelpText")
  113.    end if
  114.    ' Finally, we can delete the remaining keys...
  115.    Call RegDeletePath(s1 & s3 & "WabFind\0")
  116.    Call RegDeletePath(s1 & s3 & "WabFind")
  117.    ' as Pierre would say, "Voilα"
  118.   end if
  119.  end if
  120.  
  121.  ' This follows precisely the same pattern as above, so there's no point in repeating the comments :)
  122.  b=GetUIElement(3)
  123.  if b=true then
  124.   Call RegWriteValue(s1 & s3 & "WebSearch\@","{07798131-AF23-11d1-9111-00A0C98BA67D}",1)
  125.   Call RegWriteValue(s1 & s3 & "WebSearch\0\@","On the &Internet...",1)
  126.   Call RegWriteValue(s1 & s3 & "WebSearch\0\DefaultIcon\@", w &"shdocvw.dll,-111",1)
  127.  else
  128.   f=RegPathExists(s1 & s3 & "WebSearch")
  129.   if f=true then
  130.    Call RegDeleteValue(s1 & s3 & "WebSearch\0\DefaultIcon\@")
  131.    Call RegDeletePath(s1 & s3 & "WebSearch\0\DefaultIcon")
  132.    g=RegPathExists(s1 & s3 & "WebSearch\0\HelpText")
  133.    if g=true then
  134.     Call RegDeletePath(s1 & s3 & "WebSearch\0\HelpText")
  135.    end if
  136.    Call RegDeletePath(s1 & s3 & "WebSearch\0")
  137.    Call RegDeletePath(s1 & s3 & "WebSearch")
  138.   end if
  139.  end if
  140.  
  141.  ' This follows the same method as the first example, so no point in copying it.
  142.  b=GetUIElement(4)
  143.  if b=true then
  144.   Call RegWriteValue(s1 & "\{97E2C371-FDDD-11CF-807F-02608C8D98DF}\@","Find... Extensions",1)
  145.  else
  146.   f=RegPathExists(s1 & "\{97E2C371-FDDD-11CF-807F-02608C8D98DF}")
  147.   if f=true then
  148.    Call RegDeletePath(s1 & "\{97E2C371-FDDD-11CF-807F-02608C8D98DF}")
  149.   end if
  150.  end if
  151. END SUB
  152.  
  153. SUB Plugin_Terminate
  154. ' Nothing in here, but it's still needed by X-Setup :(
  155. END SUB
  156.